package vincent.com.layouttest;

import android.app.Application;
import android.content.Context;
import android.content.Intent;

import vincent.com.layouttest.service.AIDLService;
import vincent.com.layouttest.service.MessengerService;

/**
 * Created by chenzhengwen on 2015/12/8.
 */
public class MyApp extends Application {

    protected static Context mContext;

    @Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        mContext = this;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        mContext = this;
        //start service
//        Intent startService = new Intent("com.vincent.layouttest.service");
//        startService(startService);

        //start another process
        Intent messengerService = new Intent(this, MessengerService.class);
        startService(messengerService);

        //start another process
        Intent aidlService = new Intent(this, AIDLService.class);
        startService(aidlService);
    }

    public static Context getContext(){
        return mContext;
    }
}
